package com.example.datachange.controller;

import com.alibaba.fastjson.JSON;
import com.example.datachange.service.StarsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class StarsController {

    @Resource
    private StarsService starsService;

    @GetMapping
    public String print() {
        System.out.println(JSON.toJSONString(starsService.getArray()));
        return "操作成功！请查看你的控制台。";
    }

    @GetMapping("/cache")
    public String girlfriendDb() {
        System.out.println(JSON.toJSONString(starsService.girlfriendDb()));
        return "操作成功！请查看你的控制台。";
    }

}
